import { connect } from 'react-redux'
import { decrement, increment, increment_sync} from '../redux/actions/count.action'

function Counter({count, decrement, increment, increment_sync}) {
    return (
        <div>
            <button onClick={() => increment_sync(3)}>+</button>
            <span>{count}</span>
            <button onClick={() => decrement(2)}>-</button>
        </div>
    )
}

const mapStateToProps = (state) => ({
    count:state.count.count
})


export default connect(mapStateToProps, {decrement, increment, increment_sync})(Counter)